<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <!--
        1.constructor:返回对String对象属性创建的函数
        语法:String.constructor
      -->
    <!-- w3c实例 -->
    <script>
        var txt = "这是实验constructor属性";
        console.log("创建的函数:" + txt.constructor);
        //返回值: ƒ String() { [native code] },返回创建的函数
    </script>

    <!-- 
        2.lenght:表示字符串的长度
        语法:String.lenght
     -->
    <!-- w3c实例 -->
    <script>
        var txt1 = "这是实验lenght属性";
        console.log("代表字符串长度为:" + txt1.length);
        //返回12 代表字符串长度为12
    </script>

    <!-- 
        3.prototype:这个属性特别重要,它能操控原型链,这里这是简单讲解 ,后面我复习原型是会讲到
        prototype能向对象添加属性和方法,
        Prototype是全局属性,使用于所有的js对象
        语法: object.prototype.name=value;
     -->
    <!-- w3c实例 -->
    <script>
        function employee(name, jobtitle, born) {
            this.name = name;
            this.jobtitle = jobtitle;
            this.born = born;
        }
        var fred = new employee("名字", "工作名", "生日");
        employee.prototype.salary = null;
        fred.salary = 2000;
        console.log("查看新增加的属性salary:" + fred.salary);
    </script>


</body>

</html>